package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SetmealDishMapper {

    /**
     * 新增套餐菜品
     * @param setmealDishes
     */
    void save(List<SetmealDish> setmealDishes);

    /**
     *查询套餐包含的菜品
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> selectBySetmealId(Long id);

    /**
     * 删除原有套餐包含的菜品
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteByDishId(Long setmealId);

    /**
     * 删除套餐包含的菜品
     * @param ids
     */
    void deleteByDishIds(List<Long> ids);
}
